/**
 * FileName: Platform Author:   zeroleavebaoyang Date:     2018/9/4 10:47 Description:
 */
package com.shiro.sso.demo.utils;

import com.alibaba.fastjson.JSONObject;
import com.shiro.sso.demo.model.User;

public enum Platform {

    baidu, qq, weixin;

    public User transformUser(JSONObject jsonObject) {
        User user = new User();
        switch (this) {
            case baidu:
                user.setThirdId(baidu.toString() + "_" + jsonObject.getString("uid"));
                user.setUsername(jsonObject.getString("uname"));
                break;
            case qq:
                break;
        }
        return user;
    }
}
